﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using PacManPP.Managers;
using C3.XNA;

namespace PacManPP.Objects
{
    class Wall : IObject
    {
        public Vector2 positionBegin;
        public Vector2 positionEnd;
        public static int thickness = 5;
        protected GraphicsDevice graphics;

        public Color kolor = Color.White;

        public GraphicsDevice Graphics
        {
            get { return graphics; }
            set { graphics = value; }
        }

        public Wall(int x, int y , int x1 , int y1) {
            startFrame = 20;
            move = 5;
            maxFrame = 4;
            spirteSheetName = "objects1";
            positionBegin = new Vector2(x , y);
            positionEnd = new Vector2(x1 , y1);

            

            positionBegin.X = positionBegin.X * GameManager.scale;
            positionBegin.Y = positionBegin.Y * GameManager.scale ;
            positionEnd.X = positionEnd.X * GameManager.scale;
            positionEnd.Y = positionEnd.Y * GameManager.scale;

            positionBegin += (GameManager.boardBegin * GameManager.scale);
            positionEnd += (GameManager.boardBegin * GameManager.scale);

            System.Console.WriteLine(positionBegin);
           

        }

        public override void HandleInput(Microsoft.Xna.Framework.Input.KeyboardState keyboardState)
        {
           
        }


        public override void Draw(GameTime gameTime)
        {
           
            int thickness = 5;
            if ( positionBegin.Y == positionEnd.Y)
                Primitives2D.DrawLine(spriteBatch, positionBegin.X, positionBegin.Y, positionEnd.X, positionEnd.Y, kolor, thickness);
            else
                Primitives2D.DrawLine(spriteBatch, positionBegin.X, positionBegin.Y, positionEnd.X, positionEnd.Y + thickness, kolor, thickness);
        }



     
    }
}
